package StudyCode.summary.mydatetime;

import java.time.LocalDate;
import java.time.Month;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class DateCompare {
	public static void main(String[] args) {
		LocalDate ldt1 = LocalDate.of(2000, Month.NOVEMBER, 11);
		LocalDate ldt2 = LocalDate.now();
		int comparison = ldt1.compareTo(ldt2);
		if (comparison > 0) {
			System.out.println(ldt1 + " 大于 " + ldt2);
		} else if (comparison < 0) {
			System.out.println(ldt1 + " 小于 " + ldt2);
		} else {
			System.out.println(ldt1 + " 等于 " + ldt2);
		}

		if (ldt1.isAfter(ldt2)) {
			System.out.println(ldt1 + " 大于 " + ldt2);
		} else if (ldt1.isBefore(ldt2)) {
			System.out.println(ldt1 + " 小于 " + ldt2);
		} else if (ldt1.isEqual(ldt2)) {
			System.out.println(ldt1 + " 等于 " + ldt2);
		}

	}
}
